﻿<%@ Page Title="" Language="C#" MasterPageFile="~/NewMasterPage.master" AutoEventWireup="true" CodeFile="Project.aspx.cs" Inherits="ProjectPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="static/js/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
    <link href="static/js/css/redmond/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(document).ready(function () {

            $(".dialog").dialog({
                width: 460,
                modal: true,
                autoOpen: false,
                buttons: {
                    "Close": function () {
                        $(this).dialog("close");
                    }
                },
                open: function (type, data) {
                    $(this).parent().appendTo("form");
                }
            });

            $(".datepicker").datepicker({ dateFormat: 'M d, yy' });

        });
    </script>
    <style type="text/css">
        .ui-datepicker
        {
            z-index: 1003; /* must be > than popup editor (1002) */
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphMain" runat="Server">
    <div class="mbox">
        <h1>
            <a href="#">
                <%=ProjectName%></a></h1>
        <div class="text">
            <asp:Panel ID="pnlManage" runat="server">
                <table cellpadding="2" cellspacing="0" border="0" style="width: 100%">
                    <tr>
                        <td colspan="2">
                            <h3 style="margin: 0">
                                小项</h3>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="True">
                                <ContentTemplate>
                                    <asp:GridView ID="gvTasksManaged" runat="server" CellPadding="4" ForeColor="#333333"
                                        GridLines="Vertical" AutoGenerateColumns="False" Width="100%" OnRowCommand="gvTasksManaged_RowCommand"
                                        ShowHeaderWhenEmpty="True">
                                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                        <Columns>
                                            <asp:TemplateField>
                                                <HeaderTemplate>
                                                    <% if (Author.user_Code == _assgin_code)
                                                       { %>
                                                    <asp:LinkButton ID="LinkButton1" OnClientClick="$('#dialogAddChildren').dialog('open');" runat="server"
                                                        ForeColor="White">添加</asp:LinkButton>
                                                    <% }
                                                       else
                                                       {%>
                                                    <% } %>
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="LinkButton1" OnClientClick="$('#dialogViewChildren').dialog('open');"
                                                        CommandName="OpenChildren" CommandArgument='<%# Eval("Task_Code") %>' runat="server">查看</asp:LinkButton>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="名称/备注">
                                                <ItemTemplate>
                                                    <strong>
                                                        <%#Eval("Task_Title")%></strong>
                                                    <br />
                                                    <span>
                                                        <%#Eval("Task_Desc")%></span>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField HeaderText="负责人" DataField="AssginName"/>
                                            <asp:BoundField HeaderText="档案数目" DataField="Document_Count" />   
                                            <asp:BoundField HeaderText="分项数目" DataField="Folder_Count" /> 
                                            <asp:BoundField HeaderText="创建时间" DataField="Creation_Date" />
                                            <asp:BoundField HeaderText="更新时间" DataField="Updation_Date" />
                                        </Columns>
                                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                        <EditRowStyle BackColor="#999999" />
                                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                    </asp:GridView>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                            <div id="dialogAddChildren" title="添加" class="dialog">
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="True" UpdateMode="Conditional">
                                    <ContentTemplate>
                                        <table border="0">
                                            <tr>
                                                <td>
                                                    负责人:
                                                </td>
                                                <td>
                                                    &nbsp;
                                                    <asp:DropDownList ID="ddlUsers" runat="server">
                                                    </asp:DropDownList>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    名称:
                                                </td>
                                                <td>
                                                    &nbsp;
                                                    <asp:TextBox ID="txtTaskTitle" runat="server"></asp:TextBox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    描述:
                                                </td>
                                                <td>
                                                    &nbsp;
                                                    <asp:TextBox ID="txtTastDesc" runat="server" Height="100px" TextMode="MultiLine"
                                                        Width="250px"></asp:TextBox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    创建时间:
                                                </td>
                                                <td>
                                                    &nbsp;
                                                    <asp:TextBox ID="txtTaskOpenDate" runat="server" CssClass="datepicker"></asp:TextBox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <asp:Label ID="lblStatus" runat="server" ForeColor="Red" Visible="False" />
                                                </td>
                                                <td>
                                                    &nbsp;
                                                    <asp:Button ID="btnAddTask" runat="server" Text="确定" OnClick="btnAddTask_Click" />
                                                    &nbsp;&nbsp;
                                                </td>
                                            </tr>
                                        </table>
                                        <script type="text/javascript">
                                            //load a handler to the Sys.Application
                                            Sys.Application.add_load(ApplicationLoadHandler);
                                            function ApplicationLoadHandler(sender, args) {
                                                //get the page Manager Object
                                                var prm1 = Sys.WebForms.PageRequestManager.getInstance();
                                                //verify state of postback
                                                if (!prm1.get_isInAsyncPostBack()) {
                                                    prm1.add_endRequest(endRequest);
                                                }
                                            }
                                            function endRequest(sender, args) {
                                                $(".datepicker").datepicker({ dateFormat: 'M d, yy' });

                                            }
                                        </script>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </div>
        <div class="footer">
            <div class="bookmarks">
                <a href="Default.aspx">回到首页</a>
            </div>
            <a href="Compose.aspx">发送信息</a>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphSide" runat="Server">
</asp:Content>


